package com.ynny.Zuoye3;

public class Fruit {
    public String Name;
    public String area;
    public  double price;


    public Fruit(String name, String area, double price) {
        Name = name;
        this.area = area;
        this.price = price;
    }
    public Fruit(){

    };
    public String getName() {
        return Name;
    }

    public void setName(String name) {
        Name = name;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
    @Override
    public String toString() {
        return "水果：" +"\n"+     //  \n 用来转换下一行 跟回车差不多
                "  名字：" + Name + '\t' +    //   \t 就像空格用法
                "  产地：" + area + '\t' +
                "  单价：" + price ;
    }

}
